package org.sky.service;

import org.sky.base.DAO;
import org.sky.model.Authority;
import org.sky.model.Person;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-10-21
 * Time: 下午3:36
 * To change this template use FileUtil | Settings | FileUtil Templates.
 */
public interface PersonService extends DAO {
    /**
     * 按名字查找用户
     *
     * @param userName
     * @return
     */
    public Person findPersonByUserName(String userName);

    /**
     * 设置用户状态
     *
     * @param userNames
     * @param enable
     */
    public void setPersonEnable(String[] userNames, boolean enable);

    /**
     * 重写用户保存
     *
     * @param entity the Object to be same
     */
    @Override
    public void save(Object entity);

    /**
     * 用户保存
     *
     * @param person    用户对象
     * @param Authority 权限
     */
    public void save(Person person, Authority Authority);

    /**
     * 修改用户权限
     *
     * @param person    用户对象
     * @param Authority 权限
     */
    public void changeAuthority(Person person, Authority Authority);

     /**
     *   取所有用户对象
     * @return List用户对象
     */
    public List<Person> allPerson() ;


    /*不需要删除用户*/
    /*   @Override
 public <T> void delete(Class<T> entityClass, Object entityId);

 @Override
 public void delete(Object entity);*/


}
